package com.bingxue.edu.management.system.service;

import com.bingxue.edu.framework.mybatis.base.BaseService;
import com.bingxue.edu.management.system.mapper.ErrorLogMapper;
import com.bingxue.edu.management.system.model.entity.ErrorLog;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;

@Slf4j
@Service
@RequiredArgsConstructor
public class ErrorLogService extends BaseService<ErrorLogMapper, ErrorLog> {

    public void create(ErrorLog errorLog) {
        errorLog.setSubmitTime(LocalDateTime.now());
        this.save(errorLog);
        log.warn("接受到异常上报: {}", errorLog);
    }
}
